package com.example.demo.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "tb_mood", schema = "db_blog")
public class TbMoodEntity {
    private int moodId;
    private String moodContent;
    private int moodUp;
    private Timestamp moodDatetime;

    @Id
    @Column(name = "mood_id")
    public int getMoodId() {
        return moodId;
    }

    public void setMoodId(int moodId) {
        this.moodId = moodId;
    }

    @Basic
    @Column(name = "mood_content")
    public String getMoodContent() {
        return moodContent;
    }

    public void setMoodContent(String moodContent) {
        this.moodContent = moodContent;
    }

    @Basic
    @Column(name = "mood_up")
    public int getMoodUp() {
        return moodUp;
    }

    public void setMoodUp(int moodUp) {
        this.moodUp = moodUp;
    }

    @Basic
    @Column(name = "mood_datetime")
    public Timestamp getMoodDatetime() {
        return moodDatetime;
    }

    public void setMoodDatetime(Timestamp moodDatetime) {
        this.moodDatetime = moodDatetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbMoodEntity that = (TbMoodEntity) o;
        return moodId == that.moodId &&
                moodUp == that.moodUp &&
                Objects.equals(moodContent, that.moodContent) &&
                Objects.equals(moodDatetime, that.moodDatetime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(moodId, moodContent, moodUp, moodDatetime);
    }
}
